package cn.lsc.feign;

import cn.lsc.domain.Login;
import cn.lsc.enums.GlobaEnums;
import cn.lsc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UaaFallbackFactory implements FallbackFactory<uaaFeignService> {
    @Override
    public uaaFeignService create(Throwable throwable) {
        return new uaaFeignService() {
            @Override
            public JSONResult saveOrUpdate(Login login) {
                return JSONResult.error(GlobaEnums.Error);
            }
        };
    }
}
